package com.fansl.allround.open.api.constant.enums.juhe;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;

/**
 * @author fansl
 * @Description: 天气类型
 * @date 2019/9/10 11:48
 */
@Getter
@AllArgsConstructor
public enum  WeatherWidEnum {
    Wid00("00","晴"),
    Wid01("01","多云"),
    Wid02("02","阴"),
    Wid03("03","阵雨"),
    Wid04("04","雷阵雨"),
    Wid05("05","雷阵雨伴有冰雹"),
    Wid06("06","雨夹雪"),
    Wid07("07","小雨"),
    Wid08("08","中雨"),
    Wid09("09","大雨"),
    Wid10("10","暴雨"),
    Wid11("11","大暴雨"),
    Wid12("12","特大暴雨"),
    Wid13("13","阵雨"),
    Wid14("14","小雪"),
    Wid15("15","中雪"),
    Wid16("16","大雪"),
    Wid17("17","暴雪"),
    Wid18("18","雾"),
    Wid19("19","冻雨"),
    Wid20("20","沙尘暴"),
    Wid21("21","小到中雨"),
    Wid22("22","中到大雨"),
    Wid23("23","大到暴雨"),
    Wid24("24","暴雨到大暴雨"),
    Wid25("25","大暴雨到特大暴雨"),
    Wid26("26","小到中雪"),
    Wid27("27","中到大雪"),
    Wid28("28","大到暴雪"),
    Wid29("29","浮尘"),
    Wid30("30","扬沙"),
    Wid31("31","强沙尘暴"),
    Wid53("53","霾"),
    WidUnknown("unknown","霾"),
            ;
    private String name;
    private String desc;

    public static WeatherWidEnum getByName(String name){
        for (WeatherWidEnum widEnum:Arrays.asList(WeatherWidEnum.values())) {
            if(widEnum.getName().equals(name)){
                return widEnum;
            }
        }
        return WidUnknown;
    }
}
